/* ResourceManager.h
 * Manages the memory allocated to allegro objects, such as images and fonts
 *
 * Last Modified: 08.12.2013
 * Author: Guilherme S.G.
 */

#ifndef __JB_RESOURCE_MANAGER_H__
#define __JB_RESOURCE_MANAGER_H__

#include "Global.h"

class ResourceManager
{
private:
    std::map<std::string, ALLEGRO_BITMAP*> images;
    std::map<std::string, ALLEGRO_FONT*> fonts;
    std::map<std::string, ALLEGRO_SAMPLE*> sounds;
    
    std::vector<std::string> imageTags;
    std::vector<std::string> fontTags;
    std::vector<std::string> soundTags;
    
    unsigned long memoryAllocated;
    
public:
    ResourceManager();
    ~ResourceManager();
    
    ALLEGRO_BITMAP* loadImage(std::string filepath_, std::string tag_);
    ALLEGRO_FONT* loadFont(std::string filepath_, int size_, int flags_, std::string tag_);
    ALLEGRO_SAMPLE* loadSound(std::string filepath_, std::string tag_);
    
    //static void allocate(void *pointer);
    //static void deallocate(void *pointer);
};


#endif
